from django import template

register = template.Library()


@register.inclusion_tag('pgnum_inc_tag.html', name='pagenum')
def pagenum(n):
    n = 1 if int(n) < 1 else int(n)
    pn = (i for i in range(1, n + 1))
    return {'num': pn}
